package net.mingsoft.report_data.kafka.serializer;

import net.mingsoft.report_data.kafka.avro.ZkReport;
import net.mingsoft.report_data.util.AvroUtil;
import org.apache.kafka.common.serialization.Serializer;

import java.util.Map;

/**
 * @author gengfa
 * @date 22/03/28
 */
public class AvroSerializer implements Serializer<ZkReport> {

    @Override
    public void configure(Map<String, ?> configs, boolean isKey) {}

    @Override
    public byte[] serialize(String topic, ZkReport data) {
        return AvroUtil.serialize(data);
    }

    @Override
    public void close() {}
}
